import React, {Component} from 'react';
import {Link,NavLink} from 'react-router-dom'
import './App.css'
class App extends Component {
    componentDidMount() {
        console.log(this.props.history)
        //go
        //goBack
        //push
        //replace
    }

    render() {
        return (
            <>
                <div className={'a'}>
                    <a onClick={this.pagePush}>手动跳转</a><br/>
                    <a onClick={this.pageReplace}>手动跳转-不留记录</a><br/>
                    <Link to={"/goods"}>标签跳转</Link><br/>
                    <Link replace to={"/goods"}>标签跳转-不留记录</Link><br/>
                    <NavLink replace path={'/'} to={"/"}>导航标签-自动添加.active</NavLink><br/>
                </div>

            </>
        )
    }
    pagePush=()=>{
        this.props.history.push('/goods')
    }
    pageReplace=()=>{
        this.props.history.replace('/goods')
    }
}

export default App;